package day13;

// 套餐抽象类
public abstract class Package {
    protected double price;
    public Package(double price) {
        this.price = price;
    }
    public abstract void print();

}
// 话唠套餐
class MoreTalking extends Package implements Call, Message {
    public MoreTalking(double price) {
        super(58);
    }
    public void print() {
        System.out.println("话痨套餐，月费：" + price + "元");
    }
    public void call(int minutes) {
        System.out.println("正在通话中..."+minutes);
    }
    public void takeMessage(int messageCount) {
        System.out.println("正在发送短信..."+messageCount);
    }
}
class Super extends Package implements Message,Online{//超人套餐
    public Super(double price) {
        super(38);
    }
    public void print() {
        System.out.println("超人套餐，月费：" + price + "元");
    }
    public void takeMessage(int messageCount){
        System.out.println("正在发送短信..."+messageCount);
    }
    public void takeOnline(){
        System.out.println("正在上网...");
    }
}
class InTraffic extends Package implements Online{//网虫
    public InTraffic(double price) {
        super(28);
    }
    public void takeOnline() {
        System.out.println("正在上网...");
    }
    public void print() {
        System.out.println("网虫套餐，月费：" + price + "元");
    }
}